// eslint-disable-next-line
import { UserLayout, BasicLayout, RouteView } from '@/layouts'
// import { bxAnaalyse } from '@/core/icons'

// const RouteView = {
//   name: 'RouteView',
//   render: h => h('router-view')
// }

export const asyncRouterMap = [
  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: '主页' },
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import('@/views/home/Home'),
        meta: { title: '系统首页', keepAlive: false, icon: 'home', permission: ['home'] }
      },
      {
        path: '/declare',
        name: 'declare',
        redirect: '/declare/system',
        component: RouteView,
        meta: { title: '申报管理', icon: 'appstore', permission: ['declare'] },
        children: [
          {
            path: '/declare/system',
            name: 'DeclareSystem',
            component: RouteView,
            meta: { title: '申报列表', keepAlive: false, permission: ['system'] },
            redirect: '/declare/system/list',
            hideChildrenInMenu: true,
            children: [
              {
                path: '/declare/system/list',
                name: 'DeclareSystemList',
                component: () => import('@/views/declare/system/list/List'),
                meta: { title: '申报列表', keepAlive: true, permission: ['system'] },
                hidden: true
              },
              {
                path: '/declare/system/org',
                name: 'DeclareSystemOrg',
                component: () => import('@/views/declare/system/org/Org'),
                meta: { title: '申报组织列表', keepAlive: true, permission: ['system'] },
                hidden: true
              },
              {
                path: '/declare/system/detail',
                name: 'DeclareSystemDetail',
                component: () => import('@/views/declare/system/detail/Detail'),
                meta: { title: '申报组织详情', keepAlive: true, permission: ['system'] },
                hidden: true
              },
              {
                path: '/declare/system/fill',
                name: 'DeclareSystemFill',
                component: () => import('@/views/declare/system/fill/Fill'),
                meta: { title: '申报组织指标详情', keepAlive: true, permission: ['system'] },
                hidden: true
              }
            ]
          },
          {
            path: '/declare/category',
            name: 'DeclareCategory',
            component: RouteView,
            meta: { title: '类别列表', keepAlive: false, permission: ['category'] },
            redirect: '/declare/category/list',
            hideChildrenInMenu: true,
            children: [
              {
                path: '/declare/category/list',
                name: 'DeclareCategoryList',
                component: () => import('@/views/declare/category/list/List'),
                meta: { title: '类别列表', keepAlive: true, permission: ['category'] },
                hidden: true
              },
              {
                path: '/declare/category/quota',
                name: 'DeclareCategoryQuota',
                component: () => import('@/views/declare/category/quota/Quota'),
                meta: { title: '指标列表', keepAlive: true, permission: ['category'] },
                hidden: true
              }
            ]
          },
          {
            path: '/declare/level',
            name: 'DeclareLevel',
            component: () => import('@/views/declare/level/Level'),
            meta: { title: '级别列表', keepAlive: false, permission: ['level'] }
          }
        ]
      },
      {
        path: '/consumer',
        name: 'consumer',
        component: () => import('@/views/consumer/Consumer'),
        meta: { title: '用户管理', keepAlive: false, icon: 'user', permission: ['consumer'] }
      },
      {
        path: '/expert',
        name: 'expert',
        component: () => import('@/views/expert/Expert'),
        meta: { title: '专家管理', keepAlive: false, icon: 'profile', permission: ['expert'] }
      },
       {
        path: '/score',
        name: 'score',
        component: RouteView,
        meta: { title: '评分查看', keepAlive: false, icon: 'eye', permission: ['score'] },
        redirect: '/score/list',
        hideChildrenInMenu: true,
        children: [
          {
            path: '/score/list',
            name: 'ScoreList',
            component: () => import('@/views/score/List'),
            meta: { title: '评分查看列表', keepAlive: false, permission: ['score'] },
            hidden: true
          },
          {
            path: '/score/detail',
            name: 'ScoreDetail',
            component: () => import('@/views/score/Detail'),
            meta: { title: '评分查看详情', keepAlive: false, permission: ['score'] },
            hidden: true
          }
        ]
      },
      {
        path: '/unit',
        name: 'unit',
        component: () => import('@/views/unit/Unit'),
        meta: { title: '单位管理', keepAlive: false, icon: 'team', permission: ['unit'] }
      },
      {
        path: '/case',
        name: 'case',
        component: RouteView,
        meta: { title: '个案管理', keepAlive: false, icon: 'scissor', permission: ['case'] },
        redirect: '/case/list',
        hideChildrenInMenu: true,
        children: [
          {
            path: '/case/list',
            name: 'CaseList',
            component: () => import('@/views/case/Case'),
            meta: { title: '个案列表', keepAlive: false, permission: ['case'] },
            hidden: true
          },
          {
            path: '/case/detail',
            name: 'CaseDetail',
            component: () => import('@/views/case/Detail'),
            meta: { title: '申请组织填报情况', keepAlive: false, permission: ['case'] },
            hidden: true
          }
        ]
      },
      {
        path: '/notice',
        name: 'notice',
        redirect: '/notice/report',
        component: RouteView,
        meta: { title: '通告管理', icon: 'container', permission: ['notice'] },
        children: [
          {
            path: '/notice/report1',
            name: 'NoticeReport1',
            component: () => import('@/views/notice/report1/Report'),
            meta: { title: '通知公告', keepAlive: false, permission: ['notice'] }
          },
          {
            path: '/notice/report2',
            name: 'NoticeReport2',
            component: () => import('@/views/notice/report2/Report'),
            meta: { title: '材料示范', keepAlive: false, permission: ['notice'] }
          },
          {
            path: '/notice/report3',
            name: 'NoticeReport3',
            component: () => import('@/views/notice/report3/Report'),
            meta: { title: '评审结果', keepAlive: false, permission: ['notice'] }
          },
          {
            path: '/notice/push',
            name: 'NoticePush',
            component: () => import('@/views/notice/push/Push'),
            meta: { title: '消息推送', keepAlive: false, permission: ['notice'] }
          },
          {
            path: '/notice/reply',
            name: 'NoticeReply',
            component: () => import('@/views/notice/reply/Reply'),
            meta: { title: '快捷回复', keepAlive: false, permission: ['notice'] }
          },
          {
            path: '/notice/msg',
            name: 'NoticeMsg',
            component: () => import('@/views/notice/msg/Msg'),
            meta: { title: '留言管理', keepAlive: false, permission: ['notice'] }
          }
        ]
      },
      {
        path: '/admit',
        name: 'Admit',
        component: () => import('@/views/admit/Admit'),
        meta: { title: '承诺书', keepAlive: false, icon: 'form', permission: ['admit'] }
      },
      {
        path: '/yiyan',
        name: 'Yiyan',
        component: () => import('@/views/yiyan/Yiyan'),
        meta: { title: '数智', keepAlive: false, icon: 'global', permission: ['yiyan'] }
      }
    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      }
    ]
  },

  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }
]
